<?php
/*
	Copyright 2006, 2007, 2008, 2009, 2010 Bastiaan Grutters
    
    This file is part of Ages of Strife website.

    Ages of Strife website is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Ages of Strife website is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Ages of Strife website.  If not, see <http://www.gnu.org/licenses/>.
 */
include( "../global/initialize.php");

aos_header( 'Reputation' );

$statement = $dal->prepare( 'SELECT score, experience ' .
		'FROM ruler ' .
		'WHERE ruler_id = :ruler_id' );
$statement->bindParam( ':ruler_id', $_SESSION[ 'ruler_id' ], PDO::PARAM_INT );
$ruler = $dal->getObject( $statement );
$points = $ruler->experience + $ruler->score * 0.001;
?>
					<table>
						<tr><th colspan="2"><?php transprint( 'Reputation' ); ?></th></tr>
						<tr class="even">
							<td><?php transprint( 'Title' ); ?></td>
							<td><?php transprint( 'Status' ); ?></td>
						</tr>
						<tr>
							<td><?php transprint( 'Unknown' ); ?></td>
							<td><?php transprint( $points < 1 ? 'Current' : 'Exceeded' ); ?></td>
						</tr>
						<tr class="even">
							<td><?php transprint( 'Scout' ); ?></td>
							<td><?php transprint( $points >= 10 ? ( $points < 100 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr>
							<td><?php transprint( 'Skirmisher' ); ?></td>
							<td><?php transprint( $points >= 100 ? ( $points < 1000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr class="even">
							<td><?php transprint( 'Ambitious officer' ); ?></td>
							<td><?php transprint( $points >= 1000 ? ( $points < 10000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr>
							<td><?php transprint( 'General' ); ?></td>
							<td><?php transprint( $points >= 10000 ? ( $points < 100000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr class="even">
							<td><?php transprint( 'Field marshal' ); ?></td>
							<td><?php transprint( $points >= 100000 ? ( $points < 100000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr>
							<td><?php transprint( 'Grand warlord' ); ?></td>
							<td><?php transprint( $points >= 1000000 ? ( $points < 1000000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr class="even">
							<td><?php transprint( 'Battle master' ); ?></td>
							<td><?php transprint( $points >= 10000000 ? ( $points < 100000000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr>
							<td><?php transprint( 'Glorious strategist' ); ?></td>
							<td><?php transprint( $points >= 100000000 ? ( $points < 1000000000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr class="even">
							<td><?php transprint( 'Immortal emperor' ); ?></td>
							<td><?php transprint( $points >= 1000000000 ? ( $points < 10000000000 ? 'Current' : 'Exceeded' ) : '' ); ?></td>
						</tr>
						<tr>
							<td><?php transprint( 'God of Strife' ); ?></td>
							<td><?php transprint( $points >= 10000000000 ? 'Current' : '' ); ?></td>
						</tr>
					</table>
<?php
aos_footer();
?>